package com.jiezhuo.factory;

import com.digitalpetri.modbus.master.ModbusTcpMaster;
import com.digitalpetri.modbus.master.ModbusTcpMasterConfig;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
//@AllArgsConstructor
//@NoArgsConstructor
public class ModbusTcpMasterFactory  {


    public static ModbusTcpMaster mkdirModbusTcp(String address,int port) {
        ModbusTcpMasterConfig config = new ModbusTcpMasterConfig.Builder(address).setPort(port).build();
        return  new ModbusTcpMaster(config);
    }

}
